package com.spring.web.adminmanage.entities;


import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

@Table(name="menu")
public class Menu implements Serializable{

	@Id
	private Long id;

	/**
	 * 图标
	 */
	private String ico;

	/**
	 * 名称
	 */
	@NotEmpty(message="名称不能为空")
	private String name;

	/**
	 * 排序
	 */
	private Integer scort;


	/**
	 * 链接地址
	 */
	@NotEmpty(message="链接不能为空")
	private String url;

	/**
	 * 描述
	 */
	private String description;

	/**
	 * 结构顺序（对应id）
	 */
	private String pid;

	/**
	 * 是否激活
	 */
	@Transient
	private boolean active = false;

	@Transient
	private List<Menu> menuItem;


	public boolean getActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public List<Menu> getMenuItem() {
		return menuItem;
	}

	public void setMenuItem(List<Menu> menuItem) {
		this.menuItem = menuItem;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getIco() {
		return ico;
	}

	public void setIco(String ico) {
		this.ico = ico;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getScort() {
		return scort;
	}

	public void setScort(Integer scort) {
		this.scort = scort;
	}


	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public Menu() {
		super();
	}


}
